gdkwindow: Remove GdkWindowAttr.type_hint
authorBenjamin Otte <otte@redhat.com>
Sun, 6 Nov 2016 15:22:21 +0000 (16:22 +0100)
committerBenjamin Otte <otte@redhat.com>
Sun, 6 Nov 2016 15:22:21 +0000 (16:22 +0100)
Instead, let the callers call gdk_window_set_type_hint(). Which is
surprsingly what every backend did.

gdk/gdkwindow.h
gdk/mir/gdkmirwindowimpl.c
gdk/quartz/gdkwindow-quartz.c
gdk/wayland/gdkdnd-wayland.c
gdk/wayland/gdkwindow-wayland.c
gdk/win32/gdkwindow-win32.c
gdk/x11/gdkdnd-x11.c
gdk/x11/gdkwindow-x11.c
gtk/gtkwindow.c

index 8a62ba676c9730b0080886b11729a3f6aa9e5205..f53338e40ea062050e2c2a567b4dfe9c18b37986 100644 (file)
@@ -87,7 +87,6 @@ typedef enum
  * GdkWindowAttributesType:
  * @GDK_WA_X: Honor the X coordinate field
  * @GDK_WA_Y: Honor the Y coordinate field
- * @GDK_WA_TYPE_HINT: Honor the type_hint field
  *
  * Used to indicate which fields in the #GdkWindowAttr struct should be honored.
  * For example, if you filled in the “x” and “y” fields of #GdkWindowAttr,
@@ -99,8 +98,7 @@ typedef enum
 typedef enum
 {
   GDK_WA_X        = 1 << 1,
-  GDK_WA_Y        = 1 << 2,
-  GDK_WA_TYPE_HINT = 1 << 3
+  GDK_WA_Y        = 1 << 2
 } GdkWindowAttributesType;
 
 /* Size restriction enumeration.
index 39f23d9df91df96aa3addd0c6405ad7f591fba44..3ed04669c7d91d8fae7d65c1bbee139aefff6e1a 100644 (file)
@@ -174,9 +174,6 @@ _gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window, GdkWindowAttr
 
   impl->title = g_strdup (get_default_title ());
 
-  if (attributes && attributes_mask & GDK_WA_TYPE_HINT)
-    impl->type_hint = attributes->type_hint;
-
   impl->pending_spec_update = TRUE;
 
   return (GdkWindowImpl *) impl;
index 144eafd72b7b88e1133d92226ffbe1cc65760a86..27babc480e29d51dad542bf62a2bf14738031976 100644 (file)
@@ -897,9 +897,6 @@ _gdk_quartz_display_create_window_impl (GdkDisplay    *display,
     }
 
   GDK_QUARTZ_RELEASE_POOL;
-
-  if (attributes_mask & GDK_WA_TYPE_HINT)
-    gdk_window_set_type_hint (window, attributes->type_hint);
 }
 
 void
index 817b72e15fa4cfcb796d8a84ce8c90dcbc2dc87b..ca5ec779fa0f9c295e6f6d9a430c486d0d3a9711 100644 (file)
@@ -501,17 +501,21 @@ static GdkWindow *
 create_dnd_window (GdkScreen *screen)
 {
   GdkWindowAttr attrs;
+  GdkWindow *window;
   guint mask;
 
   attrs.x = attrs.y = 0;
   attrs.width = attrs.height = 100;
   attrs.wclass = GDK_INPUT_OUTPUT;
   attrs.window_type = GDK_WINDOW_TEMP;
-  attrs.type_hint = GDK_WINDOW_TYPE_HINT_DND;
 
-  mask = GDK_WA_X | GDK_WA_Y | GDK_WA_TYPE_HINT;
+  mask = GDK_WA_X | GDK_WA_Y;
+
+  window = gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
 
-  return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
+  gdk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DND);
+  
+  return window;
 }
 
 GdkDragContext *
index 0b4ee602a909c8fd59850c1ada12553d3dc81366..837fde9c8c3c5bf566236efbcd0a6817c3ce9d0b 100644 (file)
@@ -702,9 +702,6 @@ _gdk_wayland_display_create_window_impl (GdkDisplay    *display,
 
   gdk_wayland_window_create_surface (window);
 
-  if (attributes_mask & GDK_WA_TYPE_HINT)
-    gdk_window_set_type_hint (window, attributes->type_hint);
-
   frame_clock = gdk_window_get_frame_clock (window);
 
   g_signal_connect (frame_clock, "before-paint",
index 8462d5e90f6e5fb16865a74d17ccb251a274cb8c..4b51e91322425814f4d7e87b529f6ed34e7cbed2 100644 (file)
@@ -732,9 +732,8 @@ _gdk_win32_display_create_window_impl (GdkDisplay    *display,
       remaining_mask &= ~GDK_WA_Y;
     }
 
-  if ((remaining_mask & ~(GDK_WA_TYPE_HINT)) != 0)
-    g_warning ("_gdk_window_impl_new: uexpected attribute 0x%X",
-               remaining_mask & ~(GDK_WA_TYPE_HINT));
+  if (remaining_mask != 0)
+    g_warning ("_gdk_window_impl_new: uexpected attribute 0x%X", remaining_mask);
 
   hparent = GDK_WINDOW_HWND (real_parent);
 
@@ -851,9 +850,6 @@ _gdk_win32_display_create_window_impl (GdkDisplay    *display,
 
   impl->native_event_mask = GDK_STRUCTURE_MASK | event_mask;
 
-  if (attributes_mask & GDK_WA_TYPE_HINT)
-    gdk_window_set_type_hint (window, attributes->type_hint);
-
   if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY)
     dwExStyle |= WS_EX_TOOLWINDOW;
 
index 596a4de44f2ef1e20f35edecb1577d8d55ed2c00..f4cdcc33c31c4a61766ac3bc82a9160f8dee8021 100644 (file)
@@ -1994,17 +1994,21 @@ static GdkWindow *
 create_drag_window (GdkScreen *screen)
 {
   GdkWindowAttr attrs = { 0 };
+  GdkWindow *window;
   guint mask;
 
   attrs.x = attrs.y = 0;
   attrs.width = attrs.height = 100;
   attrs.wclass = GDK_INPUT_OUTPUT;
   attrs.window_type = GDK_WINDOW_TEMP;
-  attrs.type_hint = GDK_WINDOW_TYPE_HINT_DND;
 
-  mask = GDK_WA_X | GDK_WA_Y | GDK_WA_TYPE_HINT;
+  mask = GDK_WA_X | GDK_WA_Y;
+
+  window = gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
 
-  return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
+  gdk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_DND);
+  
+  return window;
 }
 
 GdkDragContext *
index f003dc37508791424c233821afec7136a535118b..8d226dca7444b92f0421af6e20b57628c0bd6041 100644 (file)
@@ -1032,9 +1032,6 @@ _gdk_x11_display_create_window_impl (GdkDisplay    *display,
       break;
     }
 
-  if (attributes_mask & GDK_WA_TYPE_HINT)
-    gdk_window_set_type_hint (window, attributes->type_hint);
-
   gdk_x11_event_source_select_events ((GdkEventSource *) display_x11->event_source,
                                       GDK_WINDOW_XID (window), event_mask,
                                       StructureNotifyMask | PropertyChangeMask);
index 4cbca1eb0223bedcaf732cad4810a03d704cf6c0..58c66c398c1ac3cb19fb6fc17d49cd45d9b86143 100644 (file)
@@ -6986,10 +6986,6 @@ gtk_window_realize (GtkWidget *widget)
       if (priv->decorated && priv->client_decorated)
         attributes.event_mask |= GDK_POINTER_MOTION_MASK;
 
-      attributes.type_hint = priv->type_hint;
-
-      attributes_mask |= GDK_WA_TYPE_HINT;
-
       gdk_window = gdk_window_new (parent_window, &attributes, attributes_mask);
     }
 
@@ -7027,6 +7023,8 @@ gtk_window_realize (GtkWidget *widget)
     gdk_window_set_transient_for (gdk_window,
                                   _gtk_widget_get_window (GTK_WIDGET (priv->transient_parent)));
 
+  gdk_window_set_type_hint (gdk_window, priv->type_hint);
+
   if (priv->title)
     gdk_window_set_title (gdk_window, priv->title);